import networkx as nx
import matplotlib.pyplot as plt

# Create a directed graph
G = nx.DiGraph()

# Adding nodes
G.add_node("Input Layer", pos=(0, 0))
G.add_node("BiLSTM Layer 1", pos=(1, 1))
G.add_node("BiLSTM Layer 2", pos=(1, -1))
G.add_node("Character Embeddings", pos=(2, 2))
G.add_node("Word Embeddings", pos=(2, 0))
G.add_node("Final Output", pos=(3, 0))

# Adding edges
G.add_edges_from([("Input Layer", "BiLSTM Layer 1"), 
                  ("Input Layer", "BiLSTM Layer 2"), 
                  ("Character Embeddings", "BiLSTM Layer 1"), 
                  ("Character Embeddings", "BiLSTM Layer 2"),
                  ("BiLSTM Layer 1", "Word Embeddings"), 
                  ("BiLSTM Layer 2", "Word Embeddings"), 
                  ("Word Embeddings", "Final Output")])

# Draw the graph
pos = nx.get_node_attributes(G, 'pos')
nx.draw(G, pos, with_labels=True, node_size=2000, node_color='skyblue', font_size=10, font_weight='bold', arrows=True, connectionstyle='arc3,rad=0.1')

# Show the plot
plt.show()
